home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 8428 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.1 KB

  1. Path: gryphon.phoenix.net!usenet
  2. From: brucew@phoenix.net (Bruce Wedding)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Why is Gets() so bad?
  5. Date: Mon, 04 Mar 1996 05:43:48 GMT
  6. Organization: BranPaul Systems
  7. Message-ID: <4hdvuv$3vr@gryphon.phoenix.net>
  8. References: <4hb1ie$pa7@ixnews2.ix.netcom.com>
  9. NNTP-Posting-Host: dial84.phoenix.net
  10. X-Newsreader: Moe's Newsreader    
  11.  
  12. In comp.lang.c
  13. studwoof@ix.netcom.com(Studcat's Big Studdog.) wrote:
  14.  
  15. >Hi.. I'm not a newbie.. I don't even use Gets(), fgets(), or scanf.. I
  16. >use my own getstring function. My question is that everywhere I see
  17. >that gets() is bad. Why exactly is it so bad? Could someone please
  18. >explain in more detail than what the FAQ does? Thanks.
  19.  
  20. It's really simple.  gets() gives you no control over the quanity
  21. of chars input.  Without this control, there is ALWAYS the
  22. possiblity of your array that stores the input being overrun.
  23.  
  24.  
  25. Bruce D. Wedding                        Have Compiler, Will Travel!
  26.               Perspicacious Programming Performed Promptly
  27. Katy, Texas, USA, Planet Earth, Milkyway Galaxy, Known Universe
  28.  
  29.